1 using UnityEngine;
2
3 namespace
ProceduralToolkit
4 {
5     
public static class DebugE
6     {
7         
private static readonly Draw.DebugDrawLine drawLine;
8
9         
static DebugE()
10         {
11             drawLine = Debug.DrawLine;
12         }
13
14         
public static void DrawRay(Ray ray)
15         {
16             DrawRay(ray, Color.white);
17         }
18
19         
public static void DrawRay(
20             Ray ray,
21             Color color,
22             
float duration = 0,
23             
bool depthTest = true)
24         {
25             Draw.WireRay(drawLine, ray, color, duration, depthTest);
26         }
27
28         
public static void DrawWireQuadXY(Vector3 position, Quaternion rotation, Vector2 scale)
29         {
30             DrawWireQuadXY(position, rotation, scale, Color.white);
31         }
32
33         
public static void DrawWireQuadXY(
34             Vector3 position,
35             Quaternion rotation,
36             Vector2 scale,
37             Color color,
38             
float duration = 0,
39             
bool depthTest = true)
40         {
41             Draw.WireQuadXY(drawLine, position, rotation, scale, color, duration, depthTest);
42         }
43
44         
public static void DrawWireQuadXZ(Vector3 position, Quaternion rotation, Vector2 scale)
45         {
46             DrawWireQuadXZ(position, rotation, scale, Color.white);
47         }
48
49         
public static void DrawWireQuadXZ(
50             Vector3 position,
51             Quaternion rotation,
52             Vector2 scale,
53             Color color,
54             
float duration = 0,
55             
bool depthTest = true)
56         {
57             Draw.WireQuadXZ(drawLine, position, rotation, scale, color, duration, depthTest);
58         }
59
60         
public static void DrawWireQuadYZ(Vector3 position, Quaternion rotation, Vector2 scale)
61         {
62             DrawWireQuadYZ(position, rotation, scale, Color.white);
63         }
64
65         
public static void DrawWireQuadYZ(
66             Vector3 position,
67             Quaternion rotation,
68             Vector2 scale,
69             Color color,
70             
float duration = 0,
71             
bool depthTest = true)
72         {
73             Draw.WireQuadYZ(drawLine, position, rotation, scale, color, duration, depthTest);
74         }
75
76         
public static void DrawWireCube(Vector3 position, Quaternion rotation, Vector3 scale)
77         {
78             DrawWireCube(position, rotation, scale, Color.white);
79         }
80
81         
public static void DrawWireCube(
82             Vector3 position,
83             Quaternion rotation,
84             Vector3 scale,
85             Color color,
86             
float duration = 0,
87             
bool depthTest = true)
88         {
89             Draw.WireCube(drawLine, position, rotation, scale, color, duration, depthTest);
90         }
91
92         
#region DrawWireCircle
93
94         
public static void DrawWireCircleXY(Vector3 position, float radius)
95         {
96             DrawWireCircleXY(position, radius, Color.white);
97         }
98
99         
public static void DrawWireCircleXY(
100             Vector3 position,
101             
float radius,
102             Color color,
103             
float duration = 0,
104             
bool depthTest = true)
105         {
106             Draw.WireCircleXY(drawLine, position, radius, color, duration, depthTest);
107         }
108
109         
public static void DrawWireCircleXY(Vector3 position, Quaternion rotation, float radius)
110         {
111             DrawWireCircleXY(position, rotation, radius, Color.white);
112         }
113
114         
public static void DrawWireCircleXY(
115             Vector3 position,
116             Quaternion rotation,
117             
float radius,
118             Color color,
119             
float duration = 0,
120             
bool depthTest = true)
121         {
122             Draw.WireCircleXY(drawLine, position, rotation, radius, color, duration, depthTest);
123         }
124
125         
public static void DrawWireCircleXZ(Vector3 position, float radius)
126         {
127             DrawWireCircleXZ(position, radius, Color.white);
128         }
129
130         
public static void DrawWireCircleXZ(
131             Vector3 position,
132             
float radius,
133             Color color,
134             
float duration = 0,
135             
bool depthTest = true)
136         {
137             Draw.WireCircleXZ(drawLine, position, radius, color, duration, depthTest);
138         }
139
140         
public static void DrawWireCircleXZ(Vector3 position, Quaternion rotation, float radius)
141         {
142             DrawWireCircleXZ(position, rotation, radius, Color.white);
143         }
144
145         
public static void DrawWireCircleXZ(
146             Vector3 position,
147             Quaternion rotation,
148             
float radius,
149             Color color,
150             
float duration = 0,
151             
bool depthTest = true)
152         {
153             Draw.WireCircleXZ(drawLine, position, rotation, radius, color, duration, depthTest);
154         }
155
156         
public static void DrawWireCircleYZ(Vector3 position, float radius)
157         {
158             DrawWireCircleYZ(position, radius, Color.white);
159         }
160
161         
public static void DrawWireCircleYZ(
162             Vector3 position,
163             
float radius,
164             Color color,
165             
float duration = 0,
166             
bool depthTest = true)
167         {
168             Draw.WireCircleYZ(drawLine, position, radius, color, duration, depthTest);
169         }
170
171         
public static void DrawWireCircleYZ(Vector3 position, Quaternion rotation, float radius)
172         {
173             DrawWireCircleYZ(position, rotation, radius, Color.white);
174         }
175
176         
public static void DrawWireCircleYZ(
177             Vector3 position,
178             Quaternion rotation,
179             
float radius,
180             Color color,
181             
float duration = 0,
182             
bool depthTest = true)
183         {
184             Draw.WireCircleYZ(drawLine, position, rotation, radius, color, duration, depthTest);
185         }
186
187         
#endregion DrawWireCicle
188
189         
#region DrawWireArc
190
191         
public static void DrawWireArcXY(Vector3 position, float radius, float fromAngle, float toAngle)
192         {
193             DrawWireArcXY(position, radius, fromAngle, toAngle, Color.white);
194         }
195
196         
public static void DrawWireArcXY(
197             Vector3 position,
198             
float radius,
199             
float fromAngle,
200             
float toAngle,
201             Color color,
202             
float duration = 0,
203             
bool depthTest = true)
204         {
205             Draw.WireArcXY(drawLine, position, radius, fromAngle, toAngle, color, duration, depthTest);
206         }
207
208         
public static void DrawWireArcXY(Vector3 position, Quaternion rotation, float radius, float fromAngle,
209             
float toAngle)
210         {
211             DrawWireArcXY(position, rotation, radius, fromAngle, toAngle, Color.white);
212         }
213
214         
public static void DrawWireArcXY(
215             Vector3 position,
216             Quaternion rotation,
217             
float radius,
218             
float fromAngle,
219             
float toAngle,
220             Color color,
221             
float duration = 0,
222             
bool depthTest = true)
223         {
224             Draw.WireArcXY(drawLine, position, rotation, radius, fromAngle, toAngle, color, duration, depthTest);
225         }
226
227         
public static void DrawWireArcXZ(Vector3 position, float radius, float fromAngle, float toAngle)
228         {
229             DrawWireArcXZ(position, radius, fromAngle, toAngle, Color.white);
230         }
231
232         
public static void DrawWireArcXZ(
233             Vector3 position,
234             
float radius,
235             
float fromAngle,
236             
float toAngle,
237             Color color,
238             
float duration = 0,
239             
bool depthTest = true)
240         {
241             Draw.WireArcXZ(drawLine, position, radius, fromAngle, toAngle, color, duration, depthTest);
242         }
243
244         
public static void DrawWireArcXZ(Vector3 position, Quaternion rotation, float radius, float fromAngle,
245             
float toAngle)
246         {
247             DrawWireArcXZ(position, rotation, radius, fromAngle, toAngle, Color.white);
248         }
249
250         
public static void DrawWireArcXZ(
251             Vector3 position,
252             Quaternion rotation,
253             
float radius,
254             
float fromAngle,
255             
float toAngle,
256             Color color,
257             
float duration = 0,
258             
bool depthTest = true)
259         {
260             Draw.WireArcXZ(drawLine, position, rotation, radius, fromAngle, toAngle, color, duration, depthTest);
261         }
262
263         
public static void DrawWireArcYZ(Vector3 position, float radius, float fromAngle, float toAngle)
264         {
265             DrawWireArcYZ(position, radius, fromAngle, toAngle, Color.white);
266         }
267
268         
public static void DrawWireArcYZ(
269             Vector3 position,
270             
float radius,
271             
float fromAngle,
272             
float toAngle,
273             Color color,
274             
float duration = 0,
275             
bool depthTest = true)
276         {
277             Draw.WireArcYZ(drawLine, position, radius, fromAngle, toAngle, color, duration, depthTest);
278         }
279
280         
public static void DrawWireArcYZ(Vector3 position, Quaternion rotation, float radius, float fromAngle,
281             
float toAngle)
282         {
283             DrawWireArcYZ(position, rotation, radius, fromAngle, toAngle, Color.white);
284         }
285
286         
public static void DrawWireArcYZ(
287             Vector3 position,
288             Quaternion rotation,
289             
float radius,
290             
float fromAngle,
291             
float toAngle,
292             Color color,
293             
float duration = 0,
294             
bool depthTest = true)
295         {
296             Draw.WireArcYZ(drawLine, position, rotation, radius, fromAngle, toAngle, color, duration, depthTest);
297         }
298
299         
#endregion DrawWireArc
300
301         
public static void DrawWireSphere(Vector3 position, Quaternion rotation, float radius)
302         {
303             DrawWireSphere(position, rotation, radius, Color.white);
304         }
305
306         
public static void DrawWireSphere(
307             Vector3 position,
308             Quaternion rotation,
309             
float radius,
310             Color color,
311             
float duration = 0,
312             
bool depthTest = true)
313         {
314             Draw.WireSphere(drawLine, position, rotation, radius, color, duration, depthTest);
315         }
316
317         
public static void DrawWireHemisphere(Vector3 position, Quaternion rotation, float radius)
318         {
319             DrawWireHemisphere(position, rotation, radius, Color.white);
320         }
321
322         
public static void DrawWireHemisphere(
323             Vector3 position,
324             Quaternion rotation,
325             
float radius,
326             Color color,
327             
float duration = 0,
328             
bool depthTest = true)
329         {
330             Draw.WireHemisphere(drawLine, position, rotation, radius, color, duration, depthTest);
331         }
332
333         
public static void DrawWireCone(
334             Vector3 position,
335             Quaternion rotation,
336             
float apexRadius,
337             
float angle,
338             
float length)
339         {
340             DrawWireCone(position, rotation, apexRadius, angle, length, Color.white);
341         }
342
343         
public static void DrawWireCone(
344             Vector3 position,
345             Quaternion rotation,
346             
float apexRadius,
347             
float angle,
348             
float length,
349             Color color,
350             
float duration = 0,
351             
bool depthTest = true)
352         {
353             Draw.WireCone(drawLine, position, rotation, apexRadius, angle, length, color, duration, depthTest);
354         }
355     }
356 }


Gõ tìm kiếm nhanh...